/*******************************************************************************
 * Copyright (c) 2000, 2006 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Author:
 *     coolair.loveU2@gmail.com
 *******************************************************************************/

package org.skyfree.ghyll.tcard.core;

import java.io.File;

import org.eclipse.core.runtime.CoreException;

/**
 * This class ...
 */

public interface ITResource
{
	/**
	 * Returns the StoragePath Object.
	 * @return
	 */
	IStoragePath getPath();
	
	/**
	 * Retrieve the information from storage layer.
	 * @throws CoreException if this method fails for below reason:
	 * <ul>
	 * <li> This resource does not exist.</li>
	 * <li> Some Error occur in storage layer.</li>
	 * </ul>
	 */
	void load() throws CoreException;
	
	/**
	 * Reload the information from storage layer.
	 * @throws CoreException if this method fails for below reason:
	 * <ul>
	 * <li> This resource does not exist.</li>
	 * <li> Some Error occur in storage layer.</li>
	 * </ul>
	 */
	void reload() throws CoreException;
	
	/**
	 * Save this resource into storage layer.
	 * @throws CoreException if this method fails for below reason:
	 * <ul>
	 * <li> Some Error occur in storage layer.</li>
	 * </ul> 
	 */
	void save()	throws CoreException;
	
	boolean isLoaded();
	
	void setPath(IStoragePath path);

	File getURI();
	
}
